
/*
 * @项目名称: 模板开发
 * @FilePath: /meek/src/lyr/Tile.js
 * @Author: 
 * @Date: 2021-01-29T16:53:45+08:00
 * @LastEditors: wanghuicong@datatang.com
 * @LastEditTime: 2022-06-30T18:00:07+08:00
 * Copyright (c) 2018-2022 
 */
                                                    
/**
 * @module ol/layer/Tile
 */
import BaseTileLayer from './BaseTile.js';
import CanvasTileLayerRenderer from '../renderer/canvas/TileLayer.js';


/**
 * @classdesc
 * For layer sources that provide pre-rendered, tiled images in grids that are
 * organized by zoom levels for specific resolutions.
 * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}
 * property on the layer object; for example, setting `title: 'My Title'` in the
 * options means that `title` is observable, and has get/set accessors.
 *
 * @api
 */
class TileLayer extends BaseTileLayer {

  /**
   * @param {import("./BaseTile.js").Options=} opt_options Tile layer options.
   */
  constructor(opt_options) {
    super(opt_options);

    this._source = opt_options.source;

    this._brightness = 1;
    this._contrast = 1;
  }

  get brightness() {
    return this._brightness;
  }
  set brightness(val) {
    return this._brightness = val;
  }
  
  get contrast() {
    return this._contrast;
  }
  set contrast(val) {
    return this._contrast = val;
  }

  getSource() {
    return this._source;
  }

  /**
   * Create a renderer for this layer.
   * @return {import("../renderer/Layer.js").default} A layer renderer.
   * @protected
   */
  createRenderer() {
    return new CanvasTileLayerRenderer(this);
  }

}

export default TileLayer;
